home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.std.c
- Subject: Re: atexit() and return from main()
- Date: Wed, 17 Jan 96 23:57:54 GMT
- Organization: none
- Message-ID: <821923074snz@genesis.demon.co.uk>
- References: <4dhfja$j50@fg70.rz.uni-karlsruhe.de> <4diicg$i9e@lyra.csx.cam.ac.uk>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <4diicg$i9e@lyra.csx.cam.ac.uk>
- nmm1@cus.cam.ac.uk "Nick Maclaren" writes:
-
- >In article <4dhfja$j50@fg70.rz.uni-karlsruhe.de>, ig25@fg70.rz.uni-karlsruhe.de
- > (Thomas Koenig) writes:
- >|> I don't see a problem when I replace the 'return 0' above with
- >|> an 'exit(0)'.
- >
- >I do. exit() may unwind the stack before calling the atexit()
- >functions, and that is actually the way that most C run-time
- >systems implement close down.
-
- Implementations that do that are non-conforming. According to 7.10.4.3:
-
- "First, all functions registered by the atexit function are called, in
- the reverse order of registration."
-
- There is no license given to destroy any existing objects before that happens.
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-